﻿<dialogs:DialogWindow x:Class="HappyBa.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dialogs="clr-namespace:Mnk.Library.WpfControls.Dialogs;assembly=Mnk.Library.WpfControls"
        xmlns:loc="clr-namespace:HappyBa.Code.Localization"
        xmlns:pages="clr-namespace:HappyBa.Pages"
        xmlns:units="clr-namespace:Mnk.Library.WpfControls.Components.Units;assembly=Mnk.Library.WpfControls"
        xmlns:dialogs1="clr-namespace:HappyBa.Dialogs"
        Title="{loc:Tr Caption}" 
        Icon="/HappyBa;component/Resources/icon.ico" 
        Width="800" Height="480" 
        MinWidth="640" MinHeight="320" 
        WindowState="Normal" ShowInTaskbar="True" Name="Self">
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="{loc:Tr File}">
                <MenuItem Header="{loc:Tr Settings}" Click="SettingsClick"/>
                <MenuItem Header="{loc:Tr Refresh}" Click="RefreshClick"/>
                <Separator/>
                <MenuItem Header="{loc:Tr Export}" Click="ExportClick"/>
                <Separator/>
                <MenuItem Header="{loc:Tr Exit}" Click="ExitClick"/>
            </MenuItem>
            <MenuItem Header="{loc:Tr About}" Click="AboutClick"/>
        </Menu>
        <GroupBox Header="{loc:Tr Profile}" DockPanel.Dock="Top" DataContext="{Binding RelativeSource={RelativeSource Self}}">
            <units:ComboBoxUnit Name="Profile" ValueCaption="{Binding ElementName=Self, Path=Config.SelectedProfile}" UnitType="Text" Title="{loc:Tr Profile}" ItemsSource="{Binding ElementName=Self, Path=Config.Profiles}"/>
        </GroupBox>
        <TabControl SelectionChanged="TabChanged" Name="Tabs" IsEnabled="{Binding ElementName=Profile,Path=IsSelected}" DataContext="{Binding ElementName=Profile, Path=SelectedValue}" >
            <TabItem Header="{loc:Tr Search}">
                <pages:SearchPage/>
            </TabItem>
            <TabItem Header="{loc:Tr Analisys}">
                <TabControl>
                    <TabItem Header="{loc:Tr Validation}">
                        <pages:ValidationPage DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
                    </TabItem>
                    <TabItem Header="{loc:Tr Statistics}">
                        <pages:StatisticsPage DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
                    </TabItem>
                    <TabItem Header="{loc:Tr UsersStatistics}">
                        <pages:UsersStatisticsPage DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
                    </TabItem>
                </TabControl>
            </TabItem>
            <TabItem Header="{loc:Tr ManageTasks}">
                <TabControl>
                    <TabItem Header="{loc:Tr TasksInProgress}">
                        <pages:TasksInProgressPage DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
                    </TabItem>
                    <TabItem Header="{loc:Tr ReadyToDev}">
                        <pages:ReadyToDevPage DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
                    </TabItem>
                </TabControl>
            </TabItem>
            <TabItem Header="{loc:Tr OrderTasksByTeam}">
                <pages:OrderTasksByTeam DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
            </TabItem>
            <TabItem Header="{loc:Tr TasksModification}">
                <pages:TasksModification DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
            </TabItem>
            <TabItem Header="{loc:Tr Settings}">
                <pages:SettingsPage DataContext="{Binding ElementName=Profile, Path=SelectedValue}"/>
            </TabItem>
        </TabControl>
    </DockPanel>
</dialogs:DialogWindow>
